package com.highstockings.service.impl;

import com.highstockings.dao.GalleryTypeMapper;
import com.highstockings.model.GalleryType;
import com.highstockings.service.GalleryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by diablo13064 on 2018/3/30.
 */
@Service("GalleryTypeService")
public class GalleryTypeServiceImpl implements GalleryTypeService {
    @Autowired
    GalleryTypeMapper galleryTypeMapper;
    @Override
    public List<GalleryType> findAllGalleryType() {
        return galleryTypeMapper.selectAllGalleryType();
    }

    @Override
    public GalleryType findGalleryTypeByType(String type) {
        return galleryTypeMapper.selectNameByType(type);
    }

    @Override
    public int addGalleryType(GalleryType type) {
        return galleryTypeMapper.insert(type);
    }
}
